/* Author : Putri Andita R
 * 		    091511059
 * Proyek 4*/


package jtk.project4.fleet.field;


import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.field.TableField;
import nl.coderight.jazz.form.field.TableField.AutoResizeMode;


public class LaborTableField extends GroupControl{
	
	private TableField<String>  laborTable;
	
	public LaborTableField(String bindID){
		
		setBindID(bindID);
		createFields();
		createLayout();
	}	
	
	private void createFields() {
		//setup table
		laborTable = new TableField<String>("labors","labor");
		laborTable.setTitle("headerlaborTable");
		laborTable.setAutoResizeMode(AutoResizeMode.ALL_COLUMNS);
		laborTable.getSelectionValues();
		
		//add columns
		laborTable.addColumn("label.name","name");
		laborTable.addColumn("label.rate","rate");
		laborTable.addColumn("label.laborHours","laborHours");
		
	}
	
	private void createLayout() {
		// TODO Auto-generated method stub
		addField(createFieldGroup(),CENTER);
	}
	
	
	private GroupControl createFieldGroup(){
		GroupControl fieldGroup=new GroupControl();
		fieldGroup.addField(laborTable,CENTER);
		return fieldGroup;
	}	
}
